package cn.mavor.day0920;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RemoveNonAlphabeticCharacters {
    public static void main(String[] args) {
        String input = "liubangzhao 上课好快#$#@$!@,";
        String output = removeNonAlphabeticCharacters(input);
        System.out.println(output);
    }

    public static String removeNonAlphabeticCharacters(String input) {
        // 使用正则表达式匹配所有非字母字符并替换为空字符串
        String regex = "[^a-zA-Z]";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(input);
        return matcher.replaceAll("");
    }
}